package com.dabai.iot.core.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;
import java.util.List;

/**
 * 告警条件输入类
 *
 * @author kev1n
 */
@Data
public class AlarmConditionInput implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 条件类型，property 属性  deviceStatus 设备行为
     */
    @Schema(description = "条件类型，property 属性  deviceStatus 设备行为")
    private String type;

    /**
     * 当属性为 deviceStatus 时，使用此值传参，目前仅支持 "online" "offline"
     */
    @Schema(description = "当属性为 deviceStatus 时，使用此值传参，目前仅支持 \"online\" \"offline\"")
    private String value;

    private List<Parameter> parameters;

    @Data
    public static class Parameter implements Serializable {

        @Serial
        private static final long serialVersionUID = 1L;

        private Long blockId;
        private String blockIdentifier;
        private Long itemId;
        private String identifier;
        private String dataType;
        private String comparator;
        private String value;
    }

}
